package dmeo2;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("结点数目：");
        System.out.println(binaryTree.size(root));
        System.out.println();
        System.out.println("叶子结点：");
        System.out.println(binaryTree.getLeafNodeCount(root));
        System.out.println();
        System.out.println("第K层节点的个数");
        System.out.println(binaryTree.getKLevelNodeCount(root, 4));
        System.out.println();
        System.out.println("树的高度：");
        System.out.println(binaryTree.getHeight(root));
        BinaryTree.TreeNode ret = binaryTree.find(root, 'A');
        System.out.println(ret.val);
       binaryTree.levelOrder(root);
        System.out.println();
        System.out.println("判断是否是完全二叉树：");
        System.out.println(binaryTree.isCompleteTree(root));
    }
}
